package com.docchatlink.constant;

import lombok.Getter;

/**
 * <p>
 *
 * </p>
 *
 * @author Mr.piggy
 * @since 2024/3/27
 */
@Getter
public enum FileStatusCodeEnum {

    UPLOADED("uploaded", "已上传"),
    TEXTED("texted", "已文本化"),
    OCRING("ocring", "对文档OCR识别中"),
    SPLITING("spliting", "切分中"),
    SPLITED("splited", "文本已切分"),
    VECTORING("vectoring", "向量中"),
    VECTORED("vectored", "已向量化"),
    FAILED("failed", "失败"),
    ;

    private String code;

    private String desc;

    FileStatusCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }


    public static FileStatusCodeEnum findByCode(String code) {
        for (FileStatusCodeEnum statusEnum : FileStatusCodeEnum.values()) {
            if (statusEnum.getCode().equals(code)) {
                return statusEnum;
            }
        }
        return null;
    }
}
